package org.bright.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.bright.entity.PurchaseOrders;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.bright.vo.PurchaseOrderVO;
import org.bright.vo.SupplierNameTotalAmountVO;

/**
 * <p>
 * 采购订单表 记录采购订单信息 Mapper 接口
 * </p>
 *
 * @author bright
 * @since 2024-10-21
 */
@Mapper
public interface PurchaseOrdersMapper extends BaseMapper<PurchaseOrders> {
    int insertBatch(@Param("purchaseOrders") List<PurchaseOrders> purchaseOrders);

    List<PurchaseOrderVO> selectAll();

//    查询供应商名称用于用户点击大订单之后的展示
    List<SupplierNameTotalAmountVO> querySupplierName(String orderId);


    List<PurchaseOrderVO> selectAllByOrderId(@Param("orderId") String orderId);

    int updateStatus(@Param("orderId") String orderId,@Param("supplierId") int supplierId,@Param("status") int status);

    int updateStatusByOrderId(@Param("orderId") String orderId,@Param("status") int status);

    int updateStatusByOrderIdFather(@Param("orderId") String supplierId,@Param("status") int status);
}
